home *** CD-ROM | disk | FTP | other *** search
/ NetNews Offline 2 / NetNews Offline Volume 2.iso / news / comp / lang / c-part1 / 9388 < prev    next >
Encoding:
Text File  |  1996-08-05  |  1.0 KB  |  33 lines

  1. Path: news.scsn.net!usenet
  2. From: Michael <mdorsey@scsn.net>
  3. Newsgroups: comp.lang.c
  4. Subject: Problem with Watcom C++ 10.5
  5. Date: Sun, 10 Mar 1996 00:38:19 -0500
  6. Organization: South Carolina SuperNet, Inc.
  7. Message-ID: <31426ACB.6AA1@scsn.net>
  8. NNTP-Posting-Host: cola144.scsn.net
  9. Mime-Version: 1.0
  10. Content-Type: text/plain; charset=us-ascii
  11. Content-Transfer-Encoding: 7bit
  12. X-Mailer: Mozilla 2.0GoldB1 (Win95; I)
  13.  
  14. I'm having a rather strange problem with Watcom C.  When using functions
  15. that output to stdout (ie printf()), it is not flushing to the screen
  16. until a newline is sent.  For example:
  17.  
  18. void main(void)
  19. {
  20.   printf("Hit Y for yes, N for no: ");
  21.   yn();
  22. }
  23.  
  24.  
  25. yn() gets the key stroke and prints yes or no.  The problem is that the
  26. statement will not be printed until the newline from the answer is sent.
  27. Kind of hard to answer a question if you can't see it.  I can get around
  28. it by flushing stdout after printf(), but I was kind of hoping there was
  29. some type of variable I could set to turn off buffering of stdout.
  30.  
  31. Thanks for any help,
  32. Michael
  33.